import { IRecord } from '@/components/Record/typing';
import { IRole } from '@/pages/System/Role/typing';
import { IPower, IUserInfo } from '@/typings';
import '@/utils/jsExtend';
import { cloneDeep } from 'lodash-es';

// 系统管理员用户信息
export const userInfo: IUserInfo = {
  id: 1000,
  account: 'admin',
  disabled: false,
  mobile: 13569852641,
  role: '系统管理员',
  roleKey: 1,
  power: '[1000][10010][10011][10012][10013][10014][1002][1003][10040][10041][10042][10043][10050][10051][10052][10053]',
  nickName: '萧策安',
  headImgUrl: 'https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg',
  creator: '沈兰舟',
  creatorAccount: '33khkhiyxw',
  date: new Date().format('yyyy-MM-dd')
};

// 已登录用户信息
export const loginUser = cloneDeep(userInfo);

// 角色列表
export const roleList: Array<IRole> = [
  {
    id: 1,
    name: '系统管理员',
    description: '维护系统正常运行',
    power: ['1000', '10010', '10011', '10012', '10013', '10014', '1002', '1003', '10040', '10041', '10042', '10043', '10050', '10051', '10052', '10053'],
    creator: '沈兰舟',
    account: '33khkhiyxw',
    date: '2021-09-04'
  },
  {
    id: 2,
    name: '平台管理员',
    description: '管理平台运行',
    power: ['1000', '10010', '10013', '10014', '10040', '10041', '10042', '10050', '10051', '10052', '10053'],
    creator: '萧策安',
    account: 'admin',
    date: '2021-09-04'
  },
  {
    id: 3,
    name: '商家',
    description: '管理店铺',
    power: ['1006', '1002', '1003'],
    creator: '萧策安',
    account: 'admin',
    date: '2021-09-04'
  },
  {
    id: 4,
    name: '财务员',
    description: '清算平台收支',
    power: ['1000', '1003'],
    creator: '萧策安',
    account: 'admin',
    date: '2021-09-04'
  },
  {
    id: 5,
    name: '审核员',
    description: '审核商家入驻、商品上新',
    power: ['1000', '10010', '10012'],
    creator: '萧策安',
    account: 'admin',
    date: '2021-09-04'
  },
  {
    id: 6,
    name: '业务员',
    description: '登记商家入驻信息',
    power: ['1000', '10011', '10010'],
    creator: '萧策安',
    account: 'admin',
    date: '2021-09-04'
  }
];

// 权限列表
export const powerList: Array<IPower> = [
  { id: '1000', label: '平台数据大屏', disabled: false },
  { id: '1006', label: '商家数据大屏', disabled: false },
  {
    id: '1001',
    label: '商家管理',
    disabled: false,
    children: [
      { id: '10010', label: '数据查询', disabled: false },
      { id: '10011', label: '商家入驻', disabled: false },
      { id: '10012', label: '商家审核', disabled: false },
      { id: '10014', label: '编辑商家', disabled: false },
      { id: '10013', label: '删除商家', disabled: false }
    ]
  },
  { id: '1002', label: '店铺管理', disabled: false },
  { id: '1003', label: '订单管理', disabled: false },
  {
    id: '1004',
    label: '账号管理',
    disabled: false,
    children: [
      { id: '10040', label: '数据查询', disabled: false },
      { id: '10041', label: '新增账号', disabled: false },
      { id: '10042', label: '编辑账号', disabled: false },
      { id: '10043', label: '删除账号', disabled: false }
    ]
  },
  {
    id: '1005',
    label: '角色管理',
    disabled: false,
    children: [
      { id: '10050', label: '数据查询', disabled: false },
      { id: '10051', label: '新增角色', disabled: false },
      { id: '10052', label: '编辑角色', disabled: false },
      { id: '10053', label: '删除角色', disabled: false }
    ]
  }
];

// 经营范围
export const businessRange: string[] = [
  '互联网科技',
  '医疗器械',
  '本地生活',
  '广告文化',
  '游戏',
  '餐饮',
  '金融服务',
  '商贸',
  '电影休闲娱乐',
  '职业人才中介',
  '建筑',
  '旅游',
  '教育'
];

// 商家管理流程
export const businessState: string[] = ['已入驻', '已撤离', '待审核', '已驳回'];

// 操作记录列表
export const recordList: IRecord[] = [];

// 公共参数
export const configs = {
  businessRange,
  businessState
};
